<?php
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
?>

<?php if ($type == 'logout') : ?>
<a href="/mi-cuenta.html" class="la"><?php echo JText::_('TPL_OW-VISION_MY_ACCOUNT'); ?></a>
<form action="<?php echo JRoute::_('index.php', true, $params->get('usesecure')); ?>" method="post" id="login-form">
	<button type="submit" class="btn btn-danger"><?php echo JText::_('JLOGOUT'); ?></button>
	<input type="hidden" name="option" value="com_users" />
	<input type="hidden" name="task" value="user.logout" />
	<input type="hidden" name="return" value="<?php echo $return; ?>" />
	<?php echo JHtml::_('form.token'); ?>
</form>
<?php else : ?>
<a href="#login-top" data-toggle="modal" class="la"><?php echo JText::_('TPL_OW-VISION_MY_ACCOUNT'); ?></a>
<div id="login-top" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">	
	<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel"><?php echo JText::_('TPL_OW-VISION_MY_ACCOUNT'); ?></h3>
  </div>
  <div class="modal-body">
  	<form action="<?php echo JRoute::_('index.php', true, $params->get('usesecure')); ?>" method="post" id="login-form" >
  		<?php if ($params->get('pretext')): ?>
  		<div class="pretext">
  			<?php echo $params->get('pretext'); ?>
  		</div>
  		<?php endif; ?>
  		<fieldset class="userdata">
  			<label for="modlgn-username"><?php echo JText::_('MOD_LOGIN_VALUE_USERNAME') ?></label>
  			<input id="modlgn-username" type="text" name="username" class="inputbox"  size="18" />

  			<label for="modlgn-passwd"><?php echo JText::_('JGLOBAL_PASSWORD') ?></label>
  			<input id="modlgn-passwd" type="password" name="password" class="inputbox" size="18"  />

  			<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
  			<label for="modlgn-remember" class="checkbox">
  				<input id="modlgn-remember" type="checkbox" name="remember" class="inputbox" value="yes"/> <?php echo JText::_('MOD_LOGIN_REMEMBER_ME') ?>
  			</label>
  			<?php endif; ?>

  			<button type="submit" class="btn"><?php echo JText::_('JLOGIN') ?></button>
  			<input type="hidden" name="option" value="com_users" />
  			<input type="hidden" name="task" value="user.login" />
  			<input type="hidden" name="return" value="<?php echo $return; ?>" />
  			<?php echo JHtml::_('form.token'); ?>
  		</fieldset>
  		<ul>
  			<li><a href="<?php echo JRoute::_('index.php?option=com_users&view=reset'); ?>"><?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_PASSWORD'); ?></a></li>
  			<li><a href="<?php echo JRoute::_('index.php?option=com_users&view=remind'); ?>"><?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_USERNAME'); ?></a></li>
  			<?php
  			$usersConfig = JComponentHelper::getParams('com_users');
  			if ($usersConfig->get('allowUserRegistration')) : ?>
  			<li><a href="/mi-cuenta.html"><?php echo JText::_('MOD_LOGIN_REGISTER'); ?></a></li>  			<?php endif; ?>
  		</ul>
  		<?php if ($params->get('posttext')): ?>
  		<div class="posttext">
  			<?php echo $params->get('posttext'); ?>
  		</div>
  		<?php endif; ?>
		</form>
	</div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
  </div>
</div>
<?php endif; ?>
